'\" t
.\"
.\" Copyright (c) 2016-2019 Red Hat.
.\" Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
.\"
.\" This program is free software; you can redistribute it and/or modify it
.\" under the terms of the GNU General Public License as published by the
.\" Free Software Foundation; either version 2 of the License, or (at your
.\" option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful, but
.\" WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
.\" or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
.\" for more details.
.\"
.TH PMPROBE 1 "PCP" "Performance Co-Pilot"
.SH NAME
\f3pmprobe\f1 \- lightweight probe for performance metrics
.SH SYNOPSIS
\f3pmprobe\f1
[\f3\-dfFiILvVz?\f1]
[\f3\-a\f1 \f2archive\f1]
[\f3\-b\f1 \f2batchsize\f1]
[\f3\-\-container\f1=\f2name\f1]
[\f3\-D\f1 \f2debug\f1]
[\f3\-\-derived\f1=\f2file\f1]
[\f3\-h\f1 \f2hostname\f1]
[\f3\-K\f1 \f2spec\f1]
[\f3\-n\f1 \f2pmnsfile\f1]
[\f3\-O\f1 \f2time\f1]
[\f3\-Z\f1 \f2timezone\f1]
[\f2metricname\f1 ...]
.SH DESCRIPTION
.B pmprobe
determines the availability of performance metrics
exported through the facilities of the Performance Co-Pilot (PCP).
.PP
The metrics of interest are named in the
.I metricname
arguments.
If
.I metricname
is a non-leaf node in the Performance Metrics Name Space (\c
.BR PMNS (5)),
then
.B pmprobe
will recursively descend the PMNS and report on all leaf nodes.
If no
.I metricname
argument is given, the root of the namespace is used.
.PP
This recursive expansion of the PMNS can be inhibited by the
.B \-F
(go faster) option, which reduces the number of roundtrips to
.BR pmcd (1)
when the
.I metricname
arguments are known to be leaf nodes ahead of time.
.PP
The output format is spartan and intended for use in wrapper
scripts creating configuration files for other PCP tools.
By default, there is one line of output per metric, with the
metric name followed by a count of the number of available values.
Error conditions are encoded as a negative value count (as
per the
.BR PMAPI (3)
protocols, but may be decoded using
.BR pmerr (1))
and followed by a textual description of the error.
.PP
Unless directed to another host by the
.B \-h
option,
.B pmprobe
will contact the Performance Metrics Collector Daemon
(PMCD) on the local host.
.PP
The
.B \-a
option causes
.B pmprobe
to use the specified set of archives rather than connecting to a PMCD.
.PP
The
.B \-L
option causes
.B pmprobe
to use a local context to collect metrics from PMDAs on the local host
without PMCD.
Only some metrics are available in this mode.
.PP
The
.BR \-a ,
.B \-h
and
.B \-L
options are mutually exclusive.
.SH OPTIONS
The available command line options are:
.TP 5
\fB\-a\fR \fIarchive\fR, \fB\-\-archive\fR=\fIarchive\fR
Performance metric values are retrieved from the set of Performance
Co-Pilot (PCP) archive files identified by the
.I archive
argument, which is a comma-separated list of names,
each of which may be the base name of an archive or the name of
a directory containing one or more archives.
.TP
\fB\-b\fR, \fB\-\-batch\fR
This option may be used to define the maximum number of metrics
to be fetched in a single request for the \fB\-v\fR option and
any
.BR pmLookupName (3)
request that
.B pmprobe
calls with a list of leaf metric names.
The default value for
.I batchsize
is 128.
This option is useful to avoid limitations on PDU request sizes
and also to stagger fetches, which may otherwise timeout if
.BR pmcd (1)
or a PMDA is slow to respond, particularly if a large
number of metrics are probed.
.TP
\fB\-\-container\fR=\fIcontainer\fR
Specify an individual
.I container
to be queried.
.TP
\fB\-d\fR, \fB\-\-version\fR
Display version number and exit.
.TP
\fB\-\-derived\fR=\fIdmfile\fR
The
.I dmfile
argument specifies a file that contains derived metric definitions
in the format described for
.BR pmLoadDerivedConfig (3).
This option provides a way to load derived metric definitions that
is an alternative to the more generic use of the
.B PCP_DERIVED_CONFIG
environment variable as described in
.BR PCPIntro (1).
Using the \fB\-\-derived\fR option and the
.B PCP_DERIVED_CONFIG
environment variable to specify the
.B same
configuration is a bad idea, so choose one or the other method.
.TP
\fB\-f\fR, \fB\-\-force\fR
When used with
.B \-i
or
.B \-I
the set of instances reported will be all of those known at the
source of the performance data.
By default the set of reported
instances are those for which values are currently available,
which may be smaller than the set reported with
.BR \-f .
.TP
\fB\-F\fR, \fB\-\-faster\fR
Assume given metric names are PMNS leaf nodes.
.TP
\fB\-h\fR \fIhost\fR, \fB\-\-host\fR=\fIhost\fR
Connect to
.BR pmcd (1)
on
.IR host ,
rather than on the default localhost.
.TP
\fB\-i\fR, \fB\-\-internal\fR
Report the internal identifiers for each instance.
The values are in decimal and prefixed by ``?''.
As a special case, the literal string
.B PM_IN_NULL
is reported for singular metrics.
.TP
\fB\-I\fR, \fB\-\-external\fR
Report the external identifiers for each instance.
The literal string
.B PM_IN_NULL
is reported for singular metrics.
.TP
\fB\-K\fR \fIspec\fR, \fB\-\-spec\-local\fR=\fIspec\fR
When using the \fB\-L/\fR option to fetch metrics from a local context,
this option controls the DSO PMDAs that should be made accessible.
The
.I spec
argument conforms to the syntax described in
.BR pmSpecLocalPMDA (3).
More than one \fB\-K\fR option may be used.
.TP
\fB\-L\fR, \fB\-\-local\-PMDA\fR
Use a local context to collect metrics from DSO PMDAs on the local host
without PMCD.
See also
.BR \-K .
.TP
\fB\-n\fR \fIpmnsfile\fR, \fB\-\-namespace\fR=\fIpmnsfile\fR
Normally
.B pmprobe
operates on the distributed Performance Metrics Name Space (PMNS),
however, if the
.B \-n
option is specified an alternative local PMNS file is loaded
from the file
.IR pmnsfile .
.TP
\fB\-O\fR \fItime\fR, \fB\-\-origin\fR=\fItime\fR
When used in conjunction with an archive source of metrics and the
options \fB\-f/\fR, the
.I time
argument defines a time origin at which the metrics should be
fetched from the set of archives.
Refer to
.BR PCPIntro (1)
for a complete description of this option, and the syntax for the
.I time
argument.
.TP
\fB\-v\fR, \fB\-\-values\fR
Report the value for each instance, as per the formatting
rules of
.BR pmPrintValue (3).
When fetching from a set of archives, only
those instances present in the first archive record for a metric will be
displayed; see also the
.B \-O
option.
The
.B \-v
option is mutually exclusive with either the
.B \-I
or
.B \-i
options.
.TP
\fB\-V\fR, \fB\-\-verbose\fR
This option provides a cryptic summary of the number of messages
sent and received across the PMAPI interface.
.TP
\fB\-z\fR, \fB\-\-hostzone\fR
Change the reporting timezone to the local timezone at the host
that is the source of the performance metrics, as identified via
either the
.B \-h
or
.B \-a
options.
.TP
\fB\-Z\fR \fItimezone\fR, \fB\-\-timezone\fR=\fItimezone\fR
By default,
.B pmprobe
reports the time of day according to the local timezone on the system
where
.B pmprobe
is run.
The
.B \-Z
option changes the timezone to
.I timezone
in the format of the environment variable TZ as described in
.BR environ (7).
.TP
\fB\-?\fR, \fB\-\-help\fR
Display usage message and exit.
.SH EXAMPLES
.nf
.ft CR
$ pmprobe disk.dev
.ft CR
disk.dev.read 2
disk.dev.write 2
disk.dev.total 2
disk.dev.blkread 2
disk.dev.blkwrite 2
disk.dev.blktotal 2
disk.dev.active 2
disk.dev.response 2
.sp
.ft CR
$ pmprobe \-I disk.dev.read disk.dev.write disk.all.total
.ft CR
disk.dev.read 2 "sda" "sdb"
disk.dev.write 2 "sda" "sdb"
disk.all.total 1 PM_IN_NULL
.sp
.ft CR
$ pmprobe \-v pmcd.numagents pmcd.version pmcd.control.timeout
.ft CR
pmcd.numagents 1 9
pmcd.version 1 "5.0.0"
pmcd.control.timeout 1 5
.sp
.ft CR
$ pmprobe \-v disk.dev.total disk.all.total
.ft CR
disk.dev.total \-1012 Unknown metric name
disk.all.total 1 4992466
.fi
.ft R
.SH FILES
.TP 5
.I $PCP_VAR_DIR/pmns/*
default PMNS specification files
.SH PCP ENVIRONMENT
Environment variables with the prefix \fBPCP_\fP are used to parameterize
the file and directory names used by PCP.
On each installation, the
file \fI/etc/pcp.conf\fP contains the local values for these variables.
The \fB$PCP_CONF\fP variable may be used to specify an alternative
configuration file, as described in \fBpcp.conf\fP(5).
.PP
For environment variables affecting PCP tools, see \fBpmGetOptions\fP(3).
.SH DEBUGGING OPTIONS
The
.B \-D
or
.B \-\-debug
option enables the output of additional diagnostics on
.I stderr
to help triage problems, although the information is sometimes cryptic and
primarily intended to provide guidance for developers rather end-users.
.I debug
is a comma separated list of debugging options; use
.BR pmdbg (1)
with the
.B \-l
option to obtain
a list of the available debugging options and their meaning.
.PP
Debugging options specific to
.B pmprobe
are as follows:
.TS
box;
lf(B) | lf(B)
lf(B) | lf(R) .
Option	Description
_
appl0	batch information when \fB\-b\fP used
.TE
.SH SEE ALSO
.BR PCPIntro (1),
.BR pmcd (1),
.BR pminfo (1),
.BR pmlogdump (1),
.BR PMAPI (3),
.BR pmErrStr (3),
.BR pmGetOptions (3),
.BR pmSpecLocalPMDA (3),
.BR pcp.conf (5),
.BR pcp.env (5)
and
.BR PMNS (5).

.\" control lines for scripts/man-spell
.\" +ok+ blkread blktotal blkwrite dmfile numagents sda sdb
